import { domainService } from '~/config/server'
import { NetService } from '~/utils/net.service'
import { Inject, Debounce } from "~/core/decorator";

export class QueueLightService {
  @Inject(NetService)
  private netService: NetService

  /**
   * 新增队列
   */
  public add(data) {
    return this.netService.send({
      server: domainService.queueLightController.add,
      data,
      loading: true
    })
  } 
  /**
   * 发送渠道
   */
  public getGradeById(data) {
    return this.netService.send({
      server: domainService.queueLightController.getGradeById,
      data
    })
  } 

  /**
   * 修改队列信息
   */
  public update(data) {
    return this.netService.send({
      server: domainService.queueLightController.update,
      data,
      loading: true
    })
  }

  /**
   * 停用队列
   */
  public updateStatus(data) {
    return this.netService.send({
      server: domainService.queueLightController.updateStatus,
      data,
      loading: true
    })
  }


  /**
   * 分页查询队列信息
   */
  public getAll(data, page, sort) {
    return this.netService.send({
      server: domainService.queueLightController.getAll,
      data,
      page,
      sort,
    })
  }

  /**
   * 根据id查询详情
   */
  public view(data) {
    return this.netService.send({
      server: domainService.queueLightController.view,
      data,
      loading: true,
    })
  }

  /**
   * 根据id查询轻渠道详情
   */
  public getTagApplyById(data) {
    return this.netService.send({
      server: domainService.queueLightController.viewBusinessMessage,
      data,
      loading: true,
    })
  }
  /**
   * 队列管理/轻渠道队列 队列修改记录
   */
  public getAllChannelHistory(data,page) {
    return this.netService.send({
      server: domainService.queueLightController.getAllChannelHistory, 
      data,
      loading: true,
      page,
    })
  }
}